package cloud.estate.chargeItem.controller.ChargeItem;

import cloud.estate.chargeItem.service.ChargeItemService;
import cloud.estate.commons.bean.ChargeItem;
import cloud.estate.commons.util.JsonResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ChargeItem")
public class ChargeItemController {
    @Resource
    private ChargeItemService chargeItemService;
    @PostMapping("/addOneChargeItem")
    public JsonResult addOneChargeItem(ChargeItem chargeItem){
        return chargeItemService.addOneChargeItem(chargeItem);
    }
    @PostMapping("/deleteOneChargeItem")
    public JsonResult deleteOneChargeItem(String id){
        return chargeItemService.deleteOneChargeItem(id);
    }
    @PostMapping("/updateOneChargeItem")
    public JsonResult updateOneChargeItem(ChargeItem chargeItem){
        return chargeItemService.updateOneChargeItem(chargeItem);
    }
    @GetMapping("/findOneChargeItem")
    public JsonResult findOneChargeItem(String id){
        return chargeItemService.findOneChargeItem(id);
    }
    @GetMapping("/findAllChargeItem")
    public JsonResult findAllChargeItem(){
        return chargeItemService.findAllChargeItem();
    }
}
